#include <QCoreApplication>

#include<iostream>
#include<memory>
#include<thread>
using namespace std;

#include "hf_subject.h"
#include "hf_observer.h"
#include "hf_WeatherData.h"
#include "hf_currentconditionsdisplay.h"
using namespace HeadFirstS;


int main(int argc, char *argv[])
{
    HF_WeatherData* pWeatherData = new HF_WeatherData();
    HF_CurrentConditionsDisplay* pCurrentCondtionData(new HF_CurrentConditionsDisplay(pWeatherData));

    float temperature = 1.0f;
    float humidity    = 2.0f;
    float pressure    = 3.0f;

    pWeatherData->setMeasurements(temperature,
                                  humidity,
                                  pressure);
    std::this_thread::sleep_for(std::chrono::seconds(1));
    pWeatherData->setMeasurements(temperature,
                                  humidity,
                                  pressure);
    std::this_thread::sleep_for(std::chrono::seconds(1));
    pWeatherData->setMeasurements(temperature,
                                  humidity,
                                  pressure);
    std::this_thread::sleep_for(std::chrono::seconds(1));
    pWeatherData->setMeasurements(temperature,
                                  humidity,
                                  pressure);
}
